package com.huluobo.a2207mmonthdemo.mine;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.blankj.utilcode.util.SPUtils;
import com.huluobo.a2207mmonthdemo.R;
import com.huluobo.a2207mmonthdemo.databinding.FragmentMineBinding;
import com.huluobo.base.bean.UserBeanResult;
import com.huluobo.base.bean.VideoBeanResult;
import com.huluobo.base.db.AppDbUtils;
import com.huluobo.base.mvvm.BaseMVVMFragment;
import com.huluobo.base.net.Const;

import java.util.List;

public class MineFragment extends BaseMVVMFragment<FragmentMineBinding, MineViewModel> {

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_mine;
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {
        List<VideoBeanResult.VideoBean> videoBeans = AppDbUtils.getInstance().getVideoDao().queryVideoInfo();
        Log.i("TagA", "videos:" + videoBeans.size());
        UserBeanResult.UserBean userBean =
                AppDbUtils.getInstance().getUserDao().queryUserInfoByName(SPUtils.getInstance().getString(Const.PARAM_USERNAME));
        Log.i("TagA", "user:" + userBean.getUsername());
    }

    @Override
    protected Class<MineViewModel> getViewModel() {
        return MineViewModel.class;
    }
}